import 'package:easy_refresh/easy_refresh.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class GwEasyRefrashManager {
  static Header get defHeader => EasyRefresh.defaultHeaderBuilder.call();
  static Footer get defFooter => EasyRefresh.defaultFooterBuilder.call();

  static Header setRefrashHeader({bool clamping = false,MainAxisAlignment mainAxisAlignment = MainAxisAlignment.end}) {
    return ClassicHeader(
          dragText: 'Pull to refresh'.tr,
          armedText: 'Release ready'.tr,
          readyText: 'Refreshing...'.tr,
          processingText: 'Refreshing...'.tr,
          processedText: 'Succeeded'.tr,
          noMoreText: 'No more'.tr,
          failedText: 'Failed'.tr,
          messageText: 'Last updated at %T'.tr,
          //clamping - 是否开启bounds
          clamping: clamping,
          position: IndicatorPosition.locator,
          mainAxisAlignment: mainAxisAlignment,
          // safeArea: false
        );
  }

  static Footer setRefrashFooter({bool clamping = false,MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start}) {
    return ClassicFooter(
          dragText: 'Pull to load'.tr,
          armedText: 'Release ready'.tr,
          readyText: 'Loading...'.tr,
          processingText: 'Loading...'.tr,
          processedText: 'Succeeded'.tr,
          noMoreText: 'No more'.tr,
          failedText: 'Failed'.tr,
          messageText: 'Last updated at %T'.tr,
          position: IndicatorPosition.locator,
          clamping: clamping,
          mainAxisAlignment: mainAxisAlignment,
          safeArea: false
        );
  }
}
